import request from '@/utils/request'

// 查询政策发布列表
export function listRelease(query) {
  return request({
    url: '/policy/release/list',
    method: 'get',
    params: query
  })
}

export function examineList(query) {
  return request({
    url: '/policy/release/Audit',
    method: 'get',
    params: query
  })
}

export function receiveList(query) {
  return request({
    url: '/policy/release/receive',
    method: 'get',
    params: query
  })
}

export function receiveListIndex(query) {
  return request({
    url: '/policy/release/receive',
    method: 'get',
    params: query
  })
}

// 查询政策发布详细
export function getRelease(permissionId) {
  return request({
    url: '/policy/release/' + permissionId,
    method: 'get'
  })
}

// 新增政策发布
export function addRelease(data) {
  return request({
    url: '/policy/release',
    method: 'post',
    data: data
  })
}

// 修改政策发布
export function updateRelease(data) {
  return request({
    url: '/policy/release',
    method: 'put',
    data: data
  })
}

// 删除政策发布
export function delRelease(permissionId) {
  return request({
    url: '/policy/release/' + permissionId,
    method: 'delete'
  })
}

export function updateStatus(query) {
  return request({
    url: '/policy/release/examine',
    method: 'get',
    params: query
  })
}

export function endStatus(data) {
  return request({
    url: '/policy/release/termination',
    method: 'post',
    data: data
  })
}
//标记为已读
export function readStatus(id) {
  return request({
    url: '/policy/release/read/'+id,
    method: 'get'
  })
}

//标记感兴趣
export function interestStatus(id) {
  return request({
    url: '/policy/release/feedback/'+id,
    method: 'get'
  })
}
//查看感兴趣企业
export function interestList(query) {
  return request({
    url: '/policy/release/enterprise',
    method: 'get',
    params: query
  })
}

